<?php defined('InShopNC') or exit('Access Invalid!');?>
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/platinum.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo SHOP_RESOURCE_SITE_URL;?>/js/gold_index.js" charset="utf-8"></script>

<div class = "ag-zone">
    <div class="ag-banner">
        <?php echo $output['web_html']['platinum_p'];?>
    </div>
    <div class="brand-zone">
        <?php foreach($output['adv_list'] as $adv){ ?>
            <div class="brand-content">
                <a href="<?php echo $adv['adv_url'];?>" target="_blank"><img src="<?php echo BASE_SITE_URL.DS.DIR_UPLOAD.DS.ATTACH_ADV.DS.$adv['adv_image'];?>" /></a>
            </div>
        <?php }?>
    </div>
    <div class="ag-part-1">
        <ul>
            <li>
                <span><img src="<?php echo SHOP_TEMPLATES_URL;?>/images/new/hjxs_title.jpg" /></span>
            </li>
            <div class="gold-xianshi-list">
                <?php foreach($output['xianshi_item'] as $val) { ?>
                    <div class="gold-xianshi-item">
                        <a href="<?php echo urlShop('goods','index',array('goods_id'=> $val['goods_id']));?>"><img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_GOODS.DS.$val['goods_image'];?>">
                            <dl>
                                <dt><span><img src="<?php echo SHOP_TEMPLATES_URL;?>/images/new/clock.jpg" /> </span> 距离结束时间:<span class="time-remain" count_down="<?php echo $val['end_time']- time();?>"><i></i><em time_id="d">0</em><?php echo $lang['text_tian'];?><em time_id="h">0</em><?php echo $lang['text_hour'];?> <em time_id="m">0</em><?php echo $lang['text_minute'];?><em time_id="s">0</em><?php echo $lang['text_second'];?> </span><time></time></dt>
                                <dd class="rob-lt"><span><b><?php echo $val['goods_tag'];?></b><?php echo str_cut($val['goods_intro'],16); ?> </span><span class="right"><em>¥<?php echo(float) $val['goods_price'];?></em></span></dd>
                            </dl>
                        </a>
                    </div>
                <?php } ?>
            </div>
        </ul>
        <div class="recommended-class hot-keyword">
            <div class = "recommended-class-title">
                <div class="recommended-class-title-img">
                    <i class="icon-list" style="color:#8f5523;font-size:18px;font-weight: normal;"></i>
                </div>
                <div class="recommended-class-title-font">推荐分类</div>
            </div>
            <dl>
                <?php
                $hot_array = array();
                foreach($output['rec_search_list'] as $v) {
                    $hot_array[] = $v['value'];
                }

                $hot_search = explode(',',$output['bj_hot_search']);
                foreach($hot_search as $val){
                    ?>
                    <dd><a href="<?php echo urlShop('search', 'index', array('keyword' => $val));?>"><?php if(in_array($val,$hot_array)){?><b><?php }?><?php echo $val; ?><?php if(in_array($val,$hot_array)){?></b><?php }?></a></dd>
                <?php }?>
            </dl>
        </div>

        <div class="recommended-products">
            <dl class="slider-photos">
                <?php foreach($output['slider_list'] as $slider){ ?>
                    <dd><a href="<?php echo $slider['adv_url'];?>" target="_blank"><img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_ADV.DS.$slider['adv_image'];?>" /></a></dd>
                <?php }?>
            </dl>
        </div>

        <div class="pre-sale">
            <div class="pre-sale-title">新品牌开售预告</div>
            <div class="pre-sale-date">
                <?php for($i=1;$i<5;$i++){?>
                    <div <?php if($i==1){echo "class=\"current\"";}?> id="tab-item<?php echo $i;?>"><?php echo date('n/j',strtotime("+".$i." day"));?><br><?php echo ShowCDay($i);?></div>
                <?php }?>
            </div>
                <div class="tab-container">
                    <?php
                    $i=1;
                    $brands_id = array();
                    foreach($output['specials'] as $special){
                        $brands_id[] = $special['brand_id'];
                        ?>
                        <div class="tab-<?php echo $i;?>">
                            <dl>
                                <dd><a href="<?php echo urlShop('brand', 'list', array('brand'=>$special['brand_id']));?>"><img src="<?php echo brandImage($special['brand_image']);?>" /></a></dd>
                                <dd class="title"><a href="<?php echo urlShop('brand', 'list', array('brand'=>$special['brand_id']));?>"><?php echo $special['brand_title'];?></a></dd>
                            </dl>
                        </div>
                        <?php $i++; }?>
             </div>
            <div class="pre-sale-brands">
                <?php foreach($output['brands_list'] as $brand){ if(in_array($brand['brand_id'],$brands_id)||empty($brand['brand_pic2']))continue; ?>
                    <div class="pre-sale-brands-img"><a href="<?php echo urlShop('brand', 'list', array('brand'=>$brand['brand_id']));?>"><img src="<?php echo brandImage($brand['brand_pic2']);?>" /></a></div>
                <?php }?>
            </div>
        </div>

    </div>


    <div class="gold-presale">
        <div class="gold-presale-list">
            <div class="gold-presale-list-title"></div>
            <ul class="gold-presale-list-container">
                <?php
                $i = 0;
                foreach($output['goods_list'] as $value){ ?>
                    <li class="presale-item">
                        <a href="<?php echo urlShop('goods','index',array('goods_id'=>$value['goods_id']));?>" target="_blank" title="<?php echo $value['goods_name'];?>">
                            <img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_GOODS.DS. $value['intro_image'];?>" /></a>
                        <dl class="brd-tip">
                            <dd><h3><?php echo $value['store_name'];?></h3><h5>全场 <b><?php echo $value['intro_text'];?></b> 起</h5></dd>
                        </dl>

                    </li>
                    <?php $i++; } ?>
            </ul>
        </div>
    </div>


</div>

<script language="JavaScript">

    $(".tab-base dd").mouseover(function(){
        $(".tab-base dd").removeClass("current");
        $(this).addClass("current");
        id = $(this).attr("id").replace("tab-item","");
        $(".pre-sale-brand div").hide();
        $(".tab-"+id).show();
    });
    $(".tab-base dd:first").trigger("mouseover");
</script>